// 云函数入口文件
const cloud = require('wx-server-sdk')
cloud.init()
const db = cloud.database() //初始化数据库

exports.main = async (event, context) => {
	const dbName = event.db;
	const data = event.data
	const collection = db.collection(dbName)
	const res = await collection.add({data})
	return res
};
